package org.example.dormsystem.controller;

import org.example.dormsystem.pojo.Result;
import org.example.dormsystem.pojo.StudentBoard;
import org.example.dormsystem.service.StudentBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/board")
public class BoardController {

    @Autowired
    StudentBoardService studentBoardService;

    @GetMapping("/boardInfo")
    Result boardInfo(){
        List<Map<String,Object>> list = studentBoardService.getAll();

        return Result.success(list);
    }



}
